/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    display: flex;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
}

/* 侧边栏样式 */
.sidebar {
    width: 200px;
    background: linear-gradient(180deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding-top: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar a {
    padding: 15px 20px;
    display: block;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar a:hover {
    background-color: rgba(255,255,255,0.1);
    border-left-color: #fff;
    transform: translateX(5px);
}

.sidebar a.active {
    background-color: rgba(255,255,255,0.2);
    border-left-color: #fff;
    font-weight: bold;
}

/* 主内容区域 */
.content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    background-color: #f8f9fa;
}

/* 页面通用样式 */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
    display: flex;
    align-items: center;
}

h2::before {
    content: "📊";
    margin-right: 10px;
    font-size: 24px;
}

/* 表单通用样式 */
input[type="text"], input[type="file"], select {
    padding: 12px 15px;
    margin: 8px 0 15px 0;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 只读输入框样式 */
input[type="text"]:read-only {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
    border-color: #ddd;
}

input[type="text"]:read-only:focus {
    border-color: #ddd;
    box-shadow: none;
}

button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f99);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

button:active {
    transform: translateY(0);
}

/* 设备配置页面样式 */
.config-tabs {
    display: flex;
    border-bottom: 3px solid #e1e8ed;
    margin-bottom: 30px;
    background-color: #fff;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.config-tab {
    padding: 15px 25px;
    cursor: pointer;
    background-color: #f8f9fa;
    border-right: 1px solid #e1e8ed;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.config-tab:last-child {
    border-right: none;
}

.config-tab:hover {
    background-color: #e9ecef;
}

.config-tab.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.config-tab.active::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.config-content {
    display: none;
}

.config-content.active {
    display: block;
}

.config-form {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
    transition: all 0.3s ease;
}

.config-form:hover {
    box-shadow: 0 6px 25px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.config-form h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e8ed;
    display: flex;
    align-items: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.form-actions {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #f1f2f6;
}

.btn-save {
    background: linear-gradient(135deg, #27ae60, #229954);
    padding: 8px 30px;
    font-weight: 600;
}

.btn-save:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
}

.btn-sync {
    background: linear-gradient(135deg, #17a2b8, #138496);
    padding: 8px 24px;
}

.btn-sync:hover {
    background: linear-gradient(135deg, #138496, #0f6674);
}

/* 状态提示样式 */
p[id$="-status"] {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
}

/* 日志显示样式 */
pre {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
}

#log-display {
    height: 400px;
    border: 2px solid #e1e8ed;
    overflow-y: auto;
    margin-top: 15px;
    border-radius: 8px;
    background-color: #2c3e50;
}

#video-container {
    width: 100%;
    max-width: 800px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    text-align: center;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding-top: 0;
    }

    .sidebar a {
        white-space: nowrap;
        min-width: 120px;
    }

    .content {
        padding: 15px;
    }
}
